#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
void reverse(char* p,int n)
{
	int left = 0;
	int right = n - 1;
	while (left <= right)
	{
		char temp = p[left];
		p[left] = p[right];
		p[right] = temp;
		left++;
		right--;
	}
	left = 0; right = n - 2;
	while (left <= right)
	{
		char temp = p[left];
		p[left] = p[right];
		p[right] = temp;
		left++;
		right--;
	}
}
int if_reverse(char* p1, char* p2, int n)
{
	int i = 0;
	for (i = 0; i < n; i++)
	{
		reverse(p1, n);
		if (strcmp(p1, p2) == 0)
			return 1;
	}
	return 0;
}
int main()
{
	char arr1[] = "ABCDEF";
	char arr2[] = "BCDEFA";
	int n = 0;
	n = strlen(arr1);
	int ret=if_reverse(arr1, arr2,n);
	if (ret)
		printf("yes\n");
	else
		printf("no\n");
	return 0;
}